/**
 * @author:albert
 */

package com.bkbw.live.battle.business.skill.ability;

import java.util.HashMap;

import com.bkbw.live.battle.business.UnitObject;
import com.bkbw.live.battle.business.skill.AbilityBase;
import com.bkbw.live.battle.business.skill.effect.DamageEffect;
import com.bkbw.live.battle.business.skill.effect.SlashDamageEffect;

public class SlashAbility extends AbilityBase{
	
	

	public SlashAbility(String abilityId, HashMap<String, Object> param) {
		super(abilityId, param);
		
	}
	
	
	@Override
	public void spellAnim()
	{
		this.unit.getMap().attackNotify(this.unit.getId(), this.unit.getTargetEnemy().getId());
		//System.out.println("id " + this.unit.getId() + " slash anim");
	}
	
	@Override
	public void trigger()
	{
		HashMap<String, Object> param = new HashMap<String, Object>();
		param.put("source", this.unit);
		param.put("target", this.unit.getTargetEnemy());
		SlashDamageEffect effect = new SlashDamageEffect(param);
		effect.applyEffect();
		//System.out.println("slash trigger");
	}
}
